package com.github.browep.bat.dao;

import android.content.Context;

/**
 * Created by IntelliJ IDEA.
 * User: paul
 * Date: 9/15/11
 * Time: 3:12 PM
 * To change this template use File | Settings | File Templates.
 */
public class Dao extends PreferencesService{

    public Dao(Context context) {
        super(context);
    }

    public void put(String key, Object value){
        if(value instanceof String){
            setStringPreference(key, (String) value);
        }
        else if(value instanceof Boolean){
            setBooleanPreference(key, (Boolean) value);
        }
        else if(value instanceof Integer){
            setIntPreference(key, (Integer) value);
        }
        else{
            throw  new IllegalArgumentException(value + " must be String, Boolean or Integer, was: " + value.getClass());
        }
    }


    public int getInt(String key){
        return getIntPreference(key);
    }



}
